if (ENABLE_NLS)
	file(GLOB PO_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po)
	file(RELATIVE_PATH REL_SOURCE_ROOT ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR})
	if ("${REL_SOURCE_ROOT}" STREQUAL "")
		set(REL_SOURCE_ROOT ".")
	endif("${REL_SOURCE_ROOT}" STREQUAL "")

	set(POT_FILE pidgin-lwqq.pot)

	configure_file(POTFILES.in.in ${CMAKE_CURRENT_BINARY_DIR}/POTFILES.in)
    
    FIND_PROGRAM(INTLTOOL_EXTRACT intltool-extract)
    FIND_PROGRAM(INTLTOOL_UPDATE intltool-update)
    FIND_PROGRAM(INTLTOOL_MERGE intltool-merge)

	add_custom_target(
		pot
		COMMAND INTLTOOL_EXTRACT=${INTLTOOL_EXTRACT} srcdir=${CMAKE_CURRENT_BINARY_DIR} ${INTLTOOL_UPDATE} --gettext-package pidgin-lwqq --pot
		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
		)
	if(WIN32)
		gettext(${CMAKE_CURRENT_SOURCE_DIR} pidgin-lwqq locale)
	else()
		gettext(${CMAKE_CURRENT_SOURCE_DIR} pidgin-lwqq share/locale)
	endif()
endif(ENABLE_NLS)

